class Person:

  def __init__(self, name, salary):
    self.name = name
    self.salary = salary

  def changeName(self, name):
    self.name = name

  def __changeSalary(self, salary):
    self.salary = salary

  def showInfo(self):
    print('My name is {}, my salary is {}'.format(self.name, str(self.salary)))

Alex = Person('Alex', 100000)
Alex.showInfo()
# My name is Alex, my salary is 100000

Alex.changeName('Wang')
Alex.showInfo()
# My name is Wang, my salary is 100000

# Alex.__changeSalary(10)
# 抛出异常: AttributeError: 'Person' object has no attribute '__changeSalary'

Alex._Person__changeSalary(10)
Alex.showInfo()
# My name is Wang, my salary is 10